/**
 * Created by Chris
 */
public class Monster {
    private State state;

    public Monster() {
        state = new PeaceState(this);
    }

    public void timePass() {
        if (state.getClass().equals(PeaceState.class)) {
            changeState(new CrazyState(this));
        } else {
            changeState(new PeaceState(this));
        }
    }

    public void changeState(State state) {
        this.state = state;
        state.enterState();
    }
}
